import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrInterviewReviewVO, HrInterviewReviewForm, HrInterviewReviewQuery } from '@/api/general/humanresources/onboard/interview/types';

/**
 * 查询面试评估意见审批列表
 * @param query
 * @returns {*}
 */

export const listHrInterviewReview = (query?: HrInterviewReviewQuery): AxiosPromise<HrInterviewReviewVO[]> => {
  return request({
    url: '/humanresource/hrInterviewReview/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询面试评估意见审批详细
 * @param id
 */
export const getHrInterviewReview = (id: string | number): AxiosPromise<HrInterviewReviewVO> => {
  return request({
    url: '/humanresource/hrInterviewReview/' + id,
    method: 'get'
  });
};

/**
 * 新增面试评估意见审批
 * @param data
 */
export const addHrInterviewReview = (data: HrInterviewReviewForm) => {
  return request({
    url: '/humanresource/hrInterviewReview',
    method: 'post',
    data: data
  });
};

/**
 * 修改面试评估意见审批
 * @param data
 */
export const updateHrInterviewReview = (data: HrInterviewReviewForm) => {
  return request({
    url: '/humanresource/hrInterviewReview',
    method: 'put',
    data: data
  });
};

/**
 * 删除面试评估意见审批
 * @param id
 */
export const delHrInterviewReview = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrInterviewReview/' + id,
    method: 'delete'
  });
};
